AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include('shared.lua')

function ENT:Initialize()
	self.Entity:SetModel( self.DefaultModel )
	
	if self.Entity.DamageType == "normal" then
		self.Entity.Damage = 150
	else
		self.Entity.Damage = 300
	end
	
	self.Cooldown = 2
	self.EnergyDraw = 10
	self.ProjectileName = "projectile_direct_heavy"
	self.ProjectileSpeed = 2500
	self.BlastRadius = 100
	
	self.BaseClass.Initialize(self)
end

function ENT:DrawFireEffect()
	if (self.RenderMode == "pulse") then
		CDEffect_sprite_pulse(self.Entity:LocalToWorld(self.FireOrigin), self.Entity.Color, 200, 0.5, 0, self.Entity)
	else
		CDEffect_sprite_pulse(self.Entity:LocalToWorld(self.FireOrigin), self.Entity.Color, 200, 0.5, 1.5, self.Entity)
	end
end

function Heavy_Pulse_Duplicate(player, position, angles, DamageType, Color)
	local newentity = ents.Create("weapon_projectile_direct_heavy")
	newentity:SetPos(position)
	newentity:SetAngles(angles)
	newentity:SetPlayer(player)
	newentity.DamageType = DamageType or "normal"
	newentity.RenderMode = RenderMode or "pulse"
	newentity.Color = Color
	newentity:Spawn()
	return newentity
end

duplicator.RegisterEntityClass("weapon_projectile_direct_heavy", Heavy_Pulse_Duplicate, "pos", "ang", "DamageType", "Color")